<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>轮廓线</title>
    <style>
        div {
            width: 200px;
            height: 200px;
        }

        .box1 {
            background-color: #bfa;
            /*border: 10px solid red;*/
            /*不会影响可见框大小, 只起到修饰作用*/
            /*outline: 20px skyblue dotted;*/
        }

        .box1:hover {
            outline: 10px double red;
        }

        .box2 {
            background-color: pink;
        }
    </style>
</head>
<body>
<div class="box1"></div>
<div class="box2"></div>
</body>
</html>